import React, { useState } from 'react'
import { Card, Button } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import MyTable from './components/MyTable'
import MyModal from './components/MyModal'

type Props = {}

export default function index({ }: Props) {
    const [visible, setVisible] = useState(false)
    const btn = <Button type="primary"
        onClick={() => setVisible(true)}
        icon={<PlusOutlined />}>
        添加广告位
    </Button>
    return (
        <div className='pageCard'>
            <PageHeaderWrapper />
            <div className='mt15'>
                <Card title={btn}>
                    <MyModal visible = { visible } setVisible = { setVisible }/>
                    <MyTable/>
                </Card>
            </div>
        </div>
    )
}